﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Example13_Csharp
{
    public interface Area
    {
        int computer(int x, int y);
    }
    public class Rectangle :Area
    {
       public  int computer(int x, int y)
        {
            return (x * y);
        }
       public int perimeter(int x, int y)
       {
           return ((x + y) * 2);
       }
    }
    public class Triangle : Area
    {
        public int computer(int x, int y)
        {
            return (x * y / 2);
        }
    }
    class interfaceArea
    {
        public static void Main(string[] args)
        {
            Rectangle rect = new Rectangle();
            Triangle tri = new Triangle();
            Area area;
            area = rect;
            Console.WriteLine("rect=" + area.computer(1, 2));
            area = tri;
            Console.WriteLine("tri=" + tri.computer(10, 2));

        }
    }
}
